﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2010A.Shopping.DTO
{
    public class ShoppingCarDto
    {
        /// <summary>
        /// 用户的唯一标识符
        /// </summary>
        public string Key { get; set; }


        /// <summary>
        /// 用户存放的商品集合(多种商品)
        /// </summary>
        public List<ShoppingCarProductInfoDto> Values { get; set; }
    }

    /// <summary>
    /// 用户存放到购物车中的商品信息
    /// </summary>
    public class ShoppingCarProductInfoDto
    {
        #region 必段字段

        /// <summary>
        /// 商品ID
        /// </summary>
        public string ProductId { get; set; }

        /// <summary>
        /// 商品价格
        /// </summary>
        public decimal ProductPrice { get; set; }

        /// <summary>
        /// 购买的商品数量
        /// </summary>
        public int ProductNumber { get; set; }

        #endregion

        #region 可扩展字段，避免显示的时候重查数据库
        /// <summary>
        /// 商品名称
        /// </summary>
        public string? ProductName { get; set; }

        /// <summary>
        /// 商品图片
        /// </summary>
        public string? ProductImage { get; set; }

       /// <summary>
       /// 商品规格
       /// </summary>
        public string? ProductSpec { get; set; }
        #endregion

        public bool StockError { get; set; } = false;
        public string? StoreName { get; set; }

    }
}
